<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>会员列表</title>
<link rel="stylesheet" type="text/css"
	href="<?=base_url()?>public/css/style.css">
<script type="text/javascript"
	src="<?=base_url()?>public/js/jq.1.12.4.js"></script>
<script type="text/javascript" src="<?=base_url()?>public/js/js.js"></script>
<style type="text/css">
/*
.add{background:url(<?=base_url()?>public/img/tb.gif) -4px -31px no-repeat;}
.ren{background:url(<?=base_url()?>public/img/tb.gif)  -4px -7px no-repeat;}
.btn_add{display: inline-block; height: 14px; vertical-align: middle; width: 26px; cursor: pointer;}
*/
</style>
	<style type="text/css">
		*{box-sizing: border-box}
		.table tr th{width:16.6%}
		#root label{height:100%;line-height:30px;display:inline-block;width:100%;border-bottom: 1px solid #e9e9e9}
		label a{display: inline-block;width:100%}
		label a i{display: inline-block;width:16.6%;float:left;font-style: normal;line-height:20px;height:100%;padding-top:10px; text-align:center;}
		#root li{line-height:30px;position:relative;}
		#root .two{padding-left:20px;display: none;}
		#root span{position:absolute;top:13px;}
		#root .add{background:url(<?=base_url()?>public/img/tb.gif) -4px -31px no-repeat;}
		#root .ren{background:url(<?=base_url()?>public/img/tb.gif) -4px -7px no-repeat;}
		#root .btn_add{position:absolute;top:13px;display: inline-block; height: 18px; vertical-align: middle; width: 16px; cursor: pointer;}

		#root {
		margin-left:10px;
		}
		#root a{text-decoration: none;color:#333}
		#root li {
			list-style-type:none;
			margin:0;
			position:relative
		}
		#root .two li::before, #root .two li::after {
			content:'';
			left:-20px;
			position:absolute;
			right:auto
		}
		#root .two li::before {
			border-left:1px dotted #999;
			height:100%;
			left:-11px;
			top:-15px;
			width:1px
		}
		#root .two li::after {
			border-top:1px dotted #999;
			height:20px;
			top:21px;
			left:-11px;
			width:15px
		}
		#root .two li.parent_li>label {
			cursor:pointer
		}
		#root .two>ul>li::before, #root .two>ul>li::after {
			border:0
		}
		#root .two li:last-child::before {
			height:35px
		}

		.leftnav h3 .jiantou{right:15px !important;}
	</style>
</head>
<body>
	<!-- 头部 -->
	<?php echo $menu?>
	<!-- 主体 -->
	<div class="main clearfix">
		<?php echo $left?>
		<div class="content">
			<div class="con">
				<div class="bikuang">
					<div class="right_title" style="height:50px;">
						<span style="float:left;margin-top:6px;">会员管理&nbsp;&nbsp; -<span style="color: #1d3e00; margin: 0;">&nbsp;&nbsp;会员列表</span></span>
						
						<?php echo form_open('admin/my_member/index',array('id'=>'myform')); ?>
						<input type="text" name="search" id="search" style="float:left;height:30px;margin-left:20px;margin-top:10px;border: 1px solid black;border-radius:5px;" >
						<input type="submit" value="搜索" style="float:left;margin-left:5px;margin-top:11px;height:30px;border-radius: 10px;width:45px;" >
						</form>
						<span style="float:right;margin-top:6px;">用户总数：<?php echo $usercount ?>&nbsp;&nbsp;新增用户数:<?php echo $newusercount ?></span>
						
					</div>
					<div class="table">
						<table class="mlist" cellpadding="0" cellspacing="0">
							<tr>
								<th>会员账号</th>
								<th>会员姓名</th>
								<th>推荐人数</th>
								<th>级别</th>
								<th>手机号</th>
								<th>状态</th>
							</tr>
							<tr>
								<td colspan="6">
									<ul id="root">
									<?php foreach ($my_users as $rs):?>
										<li>
											<?php if($rs['tj_num'] > 0): ?>
												<span class="add btn_add" acc="<?php echo $rs['user_account'] ?>" abb="1">
												</span>
											<?php endif; ?>
											<label>
												<a href="javascript:">
													<i class="info_url" style="cursor:pointer" href="member_detail/index?id=<?php echo $rs['id'];?>"><?php echo $rs['user_account'];?></i>
													<i><?php echo $rs['user_name'] ?></i>
													<i><?php echo $rs['tj_num'] ?></i>
													<i><?php echo $rs['tlv'] ?></i>
													<i><?php echo $rs['mobile'] ?></i>
													<i><?php if($rs['kick_status'] == '1') {echo "已封号";} else {echo "正常";}?></i>
												</a>
											</label>
										</li>
									<?php endforeach;?>
									</ul>
								</td>
                            </tr>

                            
						
                        	

						</table>
					</div>
					<!-- <div class="number1">
						<ul>
							<li><img src="<?=base_url()?>public/img/number_03.png"></li>
							<li><img src="<?=base_url()?>public/img/number_04.png"></li>
							<li><img src="<?=base_url()?>public/img/number_05.png"></li>
							<li><img src="<?=base_url()?>public/img/number_06.png"></li>
							<li><img src="<?=base_url()?>public/img/number_07.png"></li>
							<li><img src="<?=base_url()?>public/img/number_08.png"></li>
							<li><img src="<?=base_url()?>public/img/number_09.png"></li>
							<li><img src="<?=base_url()?>public/img/number_10.png"></li>
						</ul>
					</div> -->
				</div>
			</div>
		</div>
	</div>
</body>
</html>
<script type="text/javascript">
var url = '<?php echo site_url('admin/my_member/ajax_get_member_list') ?>';
var info_url = '<?php echo site_url('admin/member_detail/index')?>';
var time=0;
$('#root').delegate('.btn_add','click', function aa(event) {
	//alert(1);
	var time1=new Date().getTime();
		if(time1-time>=300){
			time=time1;
			$_this = $(this);
			$_this.off('click');
			if($_this.hasClass('ren')){
				$_this.parent().children('ul').remove('.two');
				$_this.removeClass('ren').addClass('add');
				$_this.on('click',aa);
			}else{
				if($_this.attr('acc')){
					$.post(url, {'acc':$_this.attr('acc')}, function(d) {
						var html = '';

						if(d){
							html += '<ul class="two">';
							for (var i = 0; i < d.length; i++) {
								html += '<li>';
								if(d[i]['tj_num'] > 0){
									html += '<span class="add btn_add" acc="'+d[i]['user_account']+'"></span>'
								}
								html += '<label>';
								html += '<a href="javascript:">'
								html += '<i class="info_url"  style="cursor:pointer" href="'+info_url+'?id='+d[i]['id']+'">'+d[i]['user_account']+'</i>';
								html += '<i>'+d[i]['user_name']+'</i>';
								html += '<i>'+d[i]['tj_num']+'</i>';
								html += '<i>'+d[i]['tlv']+'</i>';
								html += '<i>'+d[i]['mobile']+'</i>';
								if (d[i]["kick_status"] == "1"){
									html += '<i>已封号</i>';
								} else {
									html += '<i>正常</i>';
								}
								
								html += '</a>';
								html == '</label>';
								html += '</li>';
							}
							html += '</ul>';
						}

						if($_this.siblings(".two").length>=1){
							return;
						}else{
							$($_this.parent()).append(html);
							$_this.removeClass('add');
							$_this.addClass('ren');
							$_this.on('click',aa);
							$('.two').show();
						}
					});
				}
			}
		}
});
$('#root').delegate('.info_url','click',function(){
	location.href=$(this).attr('href');
})
// $('.info_url').on('click',function(){
	
// })
// $('.btn_add').on('click',function(){

// 	$_this = $(this);
// 	$_table = $($_this.parents('.mlist'));
// 	//$tr = $($($_this.parent()).parent());
// 	//console.log($($($_this.parent()).parent()));
// 	$.post(url, {'acc':$_this.attr('acc')}, function(d) {
// 		console.log(d);
// 		var html = '';
// 		if(d){
// 			html += '<ul class="two">';
// 			for (var i = 0; i < d.length; i++) {
// 				html += '<li>';
// 				if(d[i]['tj_num'] > 0){
// 					html += '<span class="add btn_add" acc="'+d[i]['user_account']+'"></span>'
// 				}
// 				html += '<label>';
// 				html += '<a href="javascript:">'
// 				html += '<i>'+d[i]['user_account']+'</i>';
// 				html += '<i>'+d[i]['user_name']+'</i>';
// 				html += '<i>'+d[i]['tj_num']+'</i>';
// 				html += '<i>'+d[i]['tlv']+'</i>';
// 				html += '<i>'+d[i]['mobile']+'</i>';
// 				if (d[i]["kick_status"] == "1"){
// 					html += '<i>已封号</i>';
// 				} else {
// 					html += '<i>正常</i>';
// 				}
				
// //					html += '<i>'+d[i]['mobile']+'</i>';
// 				html += '</a>';
// 				html == '</label>';
// 				html += '</li>';
// 			}
// 			html += '</ul>';
// 		}
		
// 		$($_this.parent()).append(html);
// 		$_this.removeClass('add');
// 		$_this.addClass('ren');
// 		$('.two').show();
// 	});

// })
</script>